From e4d5b8151802517b2943756fc0d09ffa95e2c4e2 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sat, 29 Jan 2022 18:21:37 +0100 Subject: chore: replace lingui functions with react-intl --- src/pages/sujet/[slug].tsx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/pages/sujet/[slug].tsx') diff --git a/src/pages/sujet/[slug].tsx b/src/pages/sujet/[slug].tsx index 65ea2fd..87a86a2 100644 --- a/src/pages/sujet/[slug].tsx +++ b/src/pages/sujet/[slug].tsx @@ -4,7 +4,6 @@ import PostPreview from '@components/PostPreview/PostPreview'; import Sidebar from '@components/Sidebar/Sidebar'; import { RelatedThematics, ToC, TopicsList } from '@components/Widgets'; import { config } from '@config/website'; -import { t } from '@lingui/macro'; import { getAllTopicsSlug, getTopicBySlug } from '@services/graphql/queries'; import styles from '@styles/pages/Page.module.scss'; import { NextPageWithLayout } from '@ts/types/app'; @@ -16,9 +15,11 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import { ParsedUrlQuery } from 'querystring'; import { useRef } from 'react'; +import { useIntl } from 'react-intl'; import { Article as Article, Graph, WebPage } from 'schema-dts'; const Topic: NextPageWithLayout = ({ topic }) => { + const intl = useIntl(); const relatedThematics = useRef([]); const router = useRouter(); @@ -128,14 +129,27 @@ const Topic: NextPageWithLayout = ({ topic }) => {
{topic.posts.length > 0 && (
-

{t`All posts in ${topic.title}`}

+

+ {intl.formatMessage( + { + defaultMessage: 'All posts in {name}', + description: 'TopicPage: posts list title', + }, + { name: topic.title } + )} +

    {getPostsList()}
)} - + -- cgit v1.2.3